﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Post : Form
    {
        public Post()
        {
            InitializeComponent();
        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var userName = textBox1.Text;
            var passWord = textBox2.Text;
            var rePassWord = textBox3.Text;

            var user = !string.IsNullOrEmpty(userName);
            var pwd = !string.IsNullOrEmpty(passWord);
            var repwd = passWord == rePassWord;

            if (user && pwd && repwd)
            {
                MessageBox.Show("注册成功");
                Login.users.Add(userName, passWord);
                this.Close();
            }
            else
            {
                MessageBox.Show("注册失败");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
